<?php if(!empty($cart))
{
	$totalprice='';
	foreach($cart as $item){
	
	?>
	<tr>
		<td><input type="checkbox" value="<?=$item['rowid']?>" name="selected[]" /></td>
		<td>
			<strong><?=$item['name']?></strong></br>
			<small><?=$item['pdesc']?></small>
		</td>
		<td>
			<?php if($item['ptype']=="WebHosting"){
				echo $item['period']."mths for $".$item['price'].'/mth';
			}else{?>
			<select  class="form-control" style="width:150px;float:left" onchange="updatecart('<?=$item['rowid']?>','<?=$item['itemid']?>',this)">
				<?php for($i=1;$i<=10;$i++){
				if($i==1)
				{
					$price=$item['regprice'];
				}
				else
				{
					$price=$item['renewprice'];
				}
				?>
				<option value="<?=$i?>" price="<?=$price?>" <?=($i==$item['qty'])?"selected='selected'" : ""?>><?=$i?> yr. for $<?=$price?>/yr.</option>
				<?}?>
			</select>
			<?}?>
		</td>
		<td>$<?=number_format((float)$item['subtotal'], 2, '.', '')?></td>
		<td>
			<button type="button" class="btn btn-info" style="padding:5px;">
				<span class="glyphicon glyphicon-cog"></span>
			</button>
			<button type="button" class="btn btn-danger" style="padding:5px;" value="0" onclick="removecart('<?=$item['rowid']?>','<?=$item['itemid']?>',this);">
				<span class="glyphicon glyphicon-trash"></span>
			</button>
		</td>
	</tr>
	<?
	if ( isset($item['child']))
	{
		foreach($item['child'] as $childitem)
		{?>
		<tr>
			<td></td>
			<td>
				<span class="glyphicon glyphicon-hand-right pull-left"></span>
				<div style="padding-left:20px;">
					<strong><?=$childitem['ptype']?></strong></br>
					
				</div>
			</td>
			<td>
				<select  class="form-control" style="width:150px;float:left" onchange="updatecart('<?=$childitem['rowid']?>','<?=$childitem['itemid']?>',this)">
					<?php for($i=1;$i<=10;$i++){?>
					<option value="<?=$i?>" price="<?=$childitem['price']?>" <?=($i==$childitem['qty'])?"selected='selected'" : ""?>><?=$i?> yr. for $<?=$childitem['price']?>/yr.</option>
					<?}?>
				</select>
				
			</td>
			<td>$<?=number_format((float)$childitem['subtotal'], 2, '.', '')?></td>
			<td>
				
				<button type="button" class="btn btn-danger" style="padding:5px;" value='0' onclick="removecart('<?=$childitem['rowid']?>','<?=$childitem['itemid']?>',this);">
					<span class="glyphicon glyphicon-trash"></span>
				</button>
				
			</td>
		</tr>
		<?php
		$totalprice+=$childitem['subtotal'];
		}
	}

	$totalprice+=$item['subtotal'];
	}?>
	<tr class="active">
		<td>
			<span class="glyphicon glyphicon-arrow-right"></span>
		</td>
		<td>
			<div class="row">
				<div class="col-sm-8">
					<select name="service" id="service" class="form-control">
						<option value="0">-- Add services to selected --</option>
						<option value="72">Add ID Protect to selected domains</option>
						<option value="140">Add Business Listing to selected domains</option>
						<option value="38">Add Email to selected domains</option>
						<option value="4">Preconfigure selected domains</option>
						<option value="5">Remove selected items</option>
						<option value="6">Empty my shopping cart</option>
					</select>
				</div>
				<button type="button" class="btn btn-info" onclick="addservice(this)">Apply</button>
				
			</div>
		</td>
		<td align="right">
			Total :
		</td>
		<td>
			$<?=number_format((float)$totalprice, 2, '.', '')?>
		</td>
		<td></td>
	</tr>
<?}?>